Skip to content

Fix call_workflow samples replay dropping workflow_name during ingestion - #58113

Merged
dsyme merged 3 commits into
mainfrom
copilot/fix-samples-mode-call-workflow-replay
Sep 3, 2026
Merged

Fix call_workflow samples replay dropping workflow_name during ingestion#58113
dsyme merged 3 commits into
mainfrom
copilot/fix-samples-mode-call-workflow-replay

Conversation

Copilot AI commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

In samples mode, the dynamically generated call_workflow MCP tool registers and replays correctly, but the ingested call_workflow message loses its workflow_name/inputs, causing the apply job to fail with "Workflow name is empty".

Root cause

pkg/workflow/safe_outputs_validation_config.go's ValidationConfig map had an entry for dispatch_workflow (declaring workflow_name/inputs fields) but no equivalent entry for call_workflow. During ingestion, collect_ndjson_output.cjs checks hasValidationConfig(itemType); when false it falls back to validateItemWithSafeJobConfig, which returns normalizedItem = { type: item.type } and nothing else whenever the safe-outputs config lacks an inputs key — true for call_workflow's config (only max/workflows/workflow_files). This silently stripped workflow_name and inputs before the apply handler (call_workflow.cjs) ever saw them.

// Before: call_workflow has no ValidationConfig entry
// ingestion normalizes {"type":"call_workflow","workflow_name":"worker","inputs":{...}}
// down to just:
{ type: "call_workflow" }  // workflow_name and inputs silently dropped

// After: with a call_workflow ValidationConfig entry
{ type: "call_workflow", workflow_name: "worker", inputs: { sentinel: "..." } }

Changes

  • pkg/workflow/safe_outputs_validation_config.go: added a call_workflow entry to ValidationConfig mirroring dispatch_workflow — required workflow_name string, optional inputs object.
  • Tests: added TestCallWorkflowValidationConfigPreservesWorkflowName (Go) and a vitest case in collect_ndjson_output.test.cjs asserting workflow_name/inputs survive ingestion for call_workflow.
  • Lock files: recompiled smoke-call-workflow.lock.yml to pick up the new validation config.

Copilot AI and others added 2 commits September 3, 2026 02:44
…ingestion

Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix samples mode: call-workflow replay drops the workflow name Fix call_workflow samples replay dropping workflow_name during ingestion Sep 3, 2026
Copilot AI requested a review from dsyme September 3, 2026 02:53
@dsyme
dsyme marked this pull request as ready for review September 3, 2026 03:14
Copilot AI balanced review requested due to automatic review settings September 3, 2026 03:14
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

No ADR enforcement needed: PR #58113 does not have the implementation label and has only 49 added lines in default business logic directories (<=100 threshold).

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Ponytail Reviewer completed successfully!

Lean already. Ship.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • ab.chatgpt.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "ab.chatgpt.com"

See Network Configuration for more information.

Generated by Ponytail Reviewer for #58113

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • github.com
  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"
    - "registry.npmjs.org"

See Network Configuration for more information.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /diagnosing-bugs — this is a well-diagnosed, minimal fix.

📋 Key Themes & Highlights

Positive Highlights

  • ✅ Root cause correctly identified: call_workflow had no ValidationConfig entry, so ingestion fell back to validateItemWithSafeJobConfig, silently dropping workflow_name/inputs.
  • ✅ Fix mirrors the existing dispatch_workflow config precisely (same field validation rules), keeping the two safe-output types consistent.
  • ✅ Includes both a Go unit test (TestCallWorkflowValidationConfigPreservesWorkflowName) and a JS regression test in collect_ndjson_output.test.cjs that reproduces the exact reported failure mode (#55176).
  • ✅ Lock file recompiled to reflect the new validation config.

No actionable issues found in the diff — scope is tight and tests directly cover the regression.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 16.1 AIC · ⌖ 14.6 AIC · ⊞ 10.3K
Comment /matt to run again

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Comment Memory

reviewed_at: 2026-09-03T03:21:00Z
review_event: REQUEST_CHANGES
top_themes:
  - regression coverage does not lock in the original failure mode
files_reviewed:
  - .github/workflows/smoke-call-workflow.lock.yml
  - actions/setup/js/collect_ndjson_output.test.cjs
  - pkg/workflow/safe_output_validation_config_test.go
  - pkg/workflow/safe_outputs_validation_config.go
comment_count: 1

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • github.com
  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"
    - "registry.npmjs.org"

See Network Configuration for more information.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 33.8 AIC · ⌖ 7.39 AIC · ⊞ 23.5K ·
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request changes

This fix plugs the immediate hole, but it still needs one more guardrail in the regression coverage before it is safe to merge.

Blocking theme

The new ingestion test only proves the happy path once call_workflow is already present in the validation config. The original bug happened specifically when that config entry was missing and ingestion fell back to the safe-job path that silently stripped every field except type. Without a test that fails when call_workflow drops out of the generated validation config, this can regress again through another compiler/config wiring path and the suite will still stay green.

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • github.com
  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"
    - "registry.npmjs.org"

See Network Configuration for more information.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 33.8 AIC · ⌖ 7.39 AIC · ⊞ 23.5K
Comment /review to run again

Comment thread actions/setup/js/collect_ndjson_output.test.cjs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Strict plain-object validation and invalid-input tests are needed before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Fixes samples-mode replay so call_workflow retains its workflow name and inputs during ingestion.

Changes:

  • Adds call_workflow validation configuration.
  • Adds Go and JavaScript regression tests.
  • Regenerates the smoke workflow lock file.
File summaries
File Review
pkg/workflow/safe_outputs_validation_config.go Adds the validation contract. Moderate: object validation is not enforced; reject arrays and other non-object inputs values and add coverage.
pkg/workflow/safe_output_validation_config_test.go Tests generated validation configuration.
actions/setup/js/collect_ndjson_output.test.cjs Tests preservation of workflow_name and inputs.
.github/workflows/smoke-call-workflow.lock.yml Includes the regenerated validation contract.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Balanced

DefaultMax: 1,
Fields: map[string]FieldValidation{
"workflow_name": {Required: true, Type: "string", Sanitize: true, MinLength: 1, MaxLength: 256, Pattern: ".*\\S.*", PatternError: "must not be empty"},
"inputs": {Type: "object"},
@dsyme
dsyme merged commit 93dcf0e into main Sep 3, 2026
115 of 126 checks passed
@dsyme
dsyme deleted the copilot/fix-samples-mode-call-workflow-replay branch September 3, 2026 03:38
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.88.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

samples mode: call-workflow replay drops the workflow name

3 participants